#!/usr/bin/expect
set v_passwd "*assword:"
set timeout 8
set user_name   [lindex $argv 0 ]
set host_ip     [lindex $argv 1 ]
set user_passwd [lindex $argv 2 ]
#spawn ssh -l $user_name $host_ip 
spawn ftp ftp://$user_name:$user_passwd@$host_ip
expect {
    "ftp>"    
    {
        send "bin\r"
    }
    "*yes/no*"    
    {
        send "yes\r"
        exp_continue
    }
    "Last login*" #if ssh can login without passwd
    {

    }
}

interact
